<template>
    <div class="wsgc">
        <Tit :tit="tit"></Tit>
        <van-row class="progress">
            <van-col
                span="8"
                :class="item.class"
                v-for="item in list"
                :key="item.id"
                @click="change(item.id)"
            >
                {{ item.title }}
            </van-col>
        </van-row>

        <div class="card">
            <div class="top">
                <img src="../../assets/shopcartimg/2.jpg" alt="" />
            </div>
            <div class="title">百纯家具</div>
            <div class="dis">就好据恢复速度回复发挥空间上的数据就会发生</div>
            <div class="money">￥200</div>
        </div>

        <div class="card">
            <div class="top">
                <img src="../../assets/shopcartimg/2.jpg" alt="" />
            </div>
            <div class="title">百纯家具</div>
            <div class="dis">就好据恢复速度回复发挥空间上的数据就会发生</div>
            <div class="money">￥200</div>
        </div>
        <div class="card">
            <div class="top">
                <img src="../../assets/shopcartimg/2.jpg" alt="" />
            </div>
            <div class="title">百纯家具</div>
            <div class="dis">就好据恢复速度回复发挥空间上的数据就会发生</div>
            <div class="money">￥200</div>
        </div>
        <div class="card">
            <div class="top">
                <img src="../../assets/shopcartimg/2.jpg" alt="" />
            </div>
            <div class="title">百纯家具</div>
            <div class="dis">就好据恢复速度回复发挥空间上的数据就会发生</div>
            <div class="money">￥200</div>
        </div>
    </div>
</template>

<script>
import Tit from "../../components/tit.vue";

export default {
    data() {
        return {
            tit: "卧室柜橱",
            list: [
                {
                    id: 1,
                    class: "red",
                    title: "销量优先",
                },
                {
                    id: 2,
                    class: "",
                    title: "价格高低",
                },
                {
                    id: 3,
                    class: "",
                    title: "综合排序",
                },
            ],
        };
    },
    components: {
        Tit,
    },
    methods: {
        change(index) {
            this.list.map((item) => (item.class = ""));
            if (index == 1) return (this.list[0].class = "red");
            if (index == 2) return (this.list[1].class = "red");
            this.list[2].class = "red";
        },
    },
};
</script>

<style scoped lang='less'>
.progress {
    font-size: 30px;
    text-align: center;
    height: 80px;
    line-height: 80px;
    background-color: white;
}
.red {
    color: #ff5555;
}
.card {
    box-shadow: 5px 5px 5px 1px #eeeeee, -5px -5px 5px 1px #eeeeee;
    width: 360px;
    height: 450px;
    margin-left: 15px;
    float: left;
    .top {
        box-sizing: border-box;
        width: 100%;
        text-align: center;
        font-size: 0;
        img {
            width: 100%;
            height: 300px;
        }
    }
    .title {
        font-size: 25px;
        font-weight: 600;
        margin-left: 20px;
        margin-top: 15px;
    }
    .dis {
        width: 300px;
        height: 60px;
        font-size: 20px;
        margin-left: 20px;
    }
    .money {
        color: red;
        font-size: 25px;
        margin-left: 20px;
    }
}
</style>